<include file="../Public/header" />
<script data-main="__PUBLIC__/admin/js/page/admin/apps/appslist" src="__PUBLIC__/admin/js/lib/requirejs/require.js"></script>
</head>

<body>
  <div class="page">
    <div class="page-hd">
      <h1>{$Think.Lang.installedApp}</h1>
    </div>

    <div class="datas">
      <div class="datas-bd">
        <table class="table">
          <thead>
            <tr>
              <th style="">{$Think.Lang.appIcon}</th>
              <th style="">{$Think.Lang.appName}</th>
              <th style="">{$Think.Lang.appAlias}</th>
              <th style="">{$Think.Lang.appType}</th>
              <th style="">{$Think.Lang.author}</th>
              <th style="">{$Think.Lang.contributor}</th>
              <th style="">{$Think.Lang.status}</th>
              <th style="">{$Think.Lang.setStatus}</th>
              <th style="">{$Think.Lang.Order}</th>
              <th style="">{$Think.Lang.operating}</th>
            </tr>
          </thead>
          <tbody>
            <php>if(empty($data)) {</php>
            <tr>
              <td>{$Think.Lang.noInstalledApp}</td>
            </tr>
            <php>}</php>
            <php>$status_alias = array('0'=>L('close'),'1'=>L('default'),'2'=>L('optional'));</php>

            <volist id="vo" name="data">
              <tr data-id="{$vo['app_id']}">
                <td>
                  <img src="{$vo['icon_url']}" />
                </td>
                <td>
                  <php>if(!empty($vo['homepage_url'])){</php> <a href="{$vo['homepage_url']}" target="_blank">{$vo['app_name']}</a>
                  <php>}else {</php>{$vo['app_name']}
                  <php>}</php>
                </td>
                <td>{$vo['app_alias']}</td>
                <td>{$vo['category']}</td>
                <td>
                  <php>if(!empty($vo['author_homepage_url'])){</php> <a href="{$vo['author_homepage_url']}" target="_blank">{$vo['author_name']}</a>
                  <php>}else {</php>{$vo['author_name']}
                  <php>}</php>
                </td>
                <td>{$vo['contributor_name']}</td>
                <td id="status_{$vo['app_id']}">{$status_alias[$vo['status']]}</td>
                <td id="setStatus_{$vo['app_id']}">
                  <volist name="status_alias" id="s">
                    <php>if($key==$vo['status']) continue;</php> 
                    <a href="javascript:;" id="J_appStatus" data-key="{$key}" data-appid="{$vo['app_id']}">{$Think.Lang.setAs}{$s}&nbsp;</a>
                  </volist>
                </td>
                <td>
                  <a href="javascript:;" class="moveup"></a>
                  <a href="javascript:;" class="movedown"></a>
                </td>
                <td>
                  <php>$uninstall_href = URL('admin/Apps/uninstall',array('app_id'=>$vo['app_id']));
                  </php> <a href="{:URL('admin/Apps/edit',array('app_id'=>$vo['app_id']))}">{$Think.Lang.editor}</a>
                  <a href="javascript:;" class="A_uninstall" onclick="if(confirm('{$Think.Lang.uninstall_alert_1}') && confirm('{$Think.Lang.uninstall_alert_2}')) location.href='{$uninstall_href}';return false;">{$Think.Lang.uninstall}</a>
                </td>
              </tr>
            </volist>
          </tbody>
        </table>
      </div>
    </div>

  </div>
</body>

</html>